/**
 * Copyright (c) 2024 Huawei Technologies Co., Ltd
 * [graph-engine] is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
*/


#ifndef PARSER_MESSAGE2OPERATOR_H
#define PARSER_MESSAGE2OPERATOR_H

#include "external/ge/ge_api_error_codes.h"
#include "external/graph/operator.h"
#include "google/protobuf/message.h"

namespace ge {
class Message2Operator {
 public:
  static Status ParseOperatorAttrs(const google::protobuf::Message *message, int depth, ge::Operator &ops);

 private:
  static Status ParseField(const google::protobuf::Reflection *reflection, const google::protobuf::Message *message,
                           const google::protobuf::FieldDescriptor *field, int depth, ge::Operator &ops);

  static Status ParseRepeatedField(const google::protobuf::Reflection *reflection,
                                   const google::protobuf::Message *message,
                                   const google::protobuf::FieldDescriptor *field, ge::Operator &ops);
};
}  // namespace ge
#endif  // PARSER_MESSAGE2OPERATOR_H
